package com.zhangbo.entity;

import java.io.Serializable;
import java.sql.Date;

public class Article implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4465493366054042423L;

	private User user;

	private Channel channel;

	private Category category;

	private String aid;

	private String title;

	private String content;

	private String picture;

	private int channelId;

	private int categoryId;

	private int userId;

	private int hits;

	private int hot;

	private int status;

	private int deleted;

	private Date created;

	private Date updated;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Channel getChannel() {
		return channel;
	}

	public void setChannel(Channel channel) {
		this.channel = channel;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public String getAid() {
		return aid;
	}

	public void setAid(String aid) {
		this.aid = aid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}

	public int getChannelId() {
		return channelId;
	}

	public void setChannelId(int channelId) {
		this.channelId = channelId;
	}

	public int getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getHits() {
		return hits;
	}

	public void setHits(int hits) {
		this.hits = hits;
	}

	public int getHot() {
		return hot;
	}

	public void setHot(int hot) {
		this.hot = hot;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getDeleted() {
		return deleted;
	}

	public void setDeleted(int deleted) {
		this.deleted = deleted;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((aid == null) ? 0 : aid.hashCode());
		result = prime * result + categoryId;
		result = prime * result + channelId;
		return result;
	}

	@Override
	public String toString() {
		return "Article [user=" + user + ", channel=" + channel + ", category=" + category + ", aid=" + aid + ", title="
				+ title + ", content=" + content + ", picture=" + picture + ", channelId=" + channelId + ", categoryId="
				+ categoryId + ", userId=" + userId + ", hits=" + hits + ", hot=" + hot + ", status=" + status
				+ ", deleted=" + deleted + ", created=" + created + ", updated=" + updated + "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Article other = (Article) obj;
		if (aid == null) {
			if (other.aid != null)
				return false;
		} else if (!aid.equals(other.aid))
			return false;
		if (categoryId != other.categoryId)
			return false;
		if (channelId != other.channelId)
			return false;
		return true;
	}

}
